package jast.config;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author Jast
 * @description 启动类
 * @date 2022-02-17 12:11
 */
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
public class ConfigApplication {
    public static void main(String[] args) throws InterruptedException {
        //SpringApplication.run(ConfigApplication.class,args);
        ConfigurableApplicationContext applicationContext = SpringApplication.run(ConfigApplication.class,args);
        while(true){
            String userName = applicationContext.getEnvironment().getProperty("user.name");
            String userAge = applicationContext.getEnvironment().getProperty("user.age");
            System.out.println("userName:"+userName+",userAge:"+userAge);
            Thread.sleep(1000);
        }
    }
}
